// 依赖实体类
const SafeString = require('../base/SafeString');
const SafeNumber = require('../base/SafeNumber');

// 配置类
const config = require('../../config').config;

/**
 * 实体类 Devive 用于设备信息
 */
class Devive {
    constructor(obj) {
        try {
            this.departmentId = new SafeNumber(obj.departmentId).value;
        } catch (err) {
            this.departmentId = null;
        }
        this.argversionId = 0;  // 不需要这个值了
        this.deviceTypeId = new SafeNumber(obj.deviceTypeId).value;
        this.devID = new SafeString(obj.devID, 1, 20).value;
        this.devPswd = new SafeString(obj.devPswd, 1, 50).value;
        this.enzymeSolution = new SafeString(obj.enzymeSolution, 0, 50).value;
        this.disinfectant = new SafeString(obj.disinfectant, 0, 50).value;
    }
}

module.exports = Devive;